
<template>
<div style="width: 430px;height: 932px;">
  <h1>维修工申请</h1>
  <van-list>
    <van-cell v-for="(item, index) in examineList" :key="index">
      <p>申请种类：{{item.sqzl}}</p>
      <p>工龄：{{item.age}}</p>
      <p>联系电话：{{item.phone}}</p>
      <p>擅长：{{item.sc}}</p>
      <p>主要事迹：{{item.zysj}}</p>
      <p>
        <van-button v-show="item.status==0" @click="toShenHe(item.id)">通过</van-button>
        <van-button v-show="item.status==0">拒绝</van-button>
      </p>
    </van-cell>
  </van-list>
</div>
</template>

<script>
import axios from "axios";

export default {
  data () {
    return {
      examineList:[],
      adminId:0,
    }
  },
  methods: {
    toShenHe(id){
      this.adminId = localStorage.getItem("adminId");
      axios.post("/admin/updatelevel?id="+this.adminId).then(res=>{
        if(res.data.code==200){
          this.$toast("审核通过")
        }else{
          this.$toast(res.data.msg)
        }
      })
      axios.post("/applyfor/deleteApply?id="+id).then(res=>{
        this.findApplyfor();
      })
    },
    findApplyfor(){
      axios.post("/applyfor/findApplyfor").then(res=>{
        this.examineList = res.data.data.list;
      })
    }
  },
  created () {
    this.findApplyfor();
  }
}
</script>


<style scoped>

</style>
